<?php
$id_category = (isset($this->pageValues['id_category'])) ? $this->pageValues['id_category'] : '';
echo $this->menuBuilder($this->menus, $id_category);
?>
<div class="orange_line" >&nbsp;</div>
<?php echo $this->form_search;?>
<div class="left_col">
    <?php echo $this->partial("index/_orderControl.phtml", array("control_active" => "orders_history"));?>
    
    <?php if (!empty($this->msg_history)):?>
        <div class="msg_order_panel">
            <p class="align_left"><?php echo $this->translate($this->msg_history)?></p>
        </div>
    <?php endif;?>  

    
    <?php if($this->paginator->count()):?>
    <table class="tbl_list_orders" id="list_orders">
        <thead>
            <tr>
                <th class="header_order_id">
                    <span><?php echo $this->translate('HEADER_ORDER_ID');?></span>
                </th>
                <th class="header_order_date">
                    <span class="align_center"><?php echo $this->translate('HEADER_ORDER_DATE');?></span>
                </th>
                <th class="header_order_total">
                    <span class="align_right"><?php echo $this->translate('HEADER_TOTAL_PAYMENT');?></span>
                </th>
            </tr>
        </thead>
        <tbody>
            <?php foreach($this->paginator as $cart):?>
            <tr>
                <td class="cart_id">
                    <a class="order_id" href="<?php echo $this->pageUrl(array('target' => 'orderdetail', 'id_cart' => $cart->id));?>">
                        <?php echo '#' . $this->escape($cart->id)?>
                    </a>
                </td>
                <td class="align_center">
                    <span class="send_time"><?php echo date($this->translate("FORMAT_DATE"), $cart->time_sent);?></span>
                </td>
                <td>
                    <div class="align_right">
                        <span class="total_price">
                            <?php echo Core_Util::formatPrice($this->store->unit_code, $cart->total_price);?>
                        </span>
                        <span><?php echo $this->store->getCurrency()?></span>
                    </div>
                </td>
            </tr>
            <?php endforeach;?>
            <tr class="end_row">
                <td colspan="3">
                    <?php echo $this->paginationControl(
                            $this->paginator,
                            'Sliding',
                            'paginatorControl.phtml',
                            array('query' => array())
                        );
                    ?>
                </td>
            </tr>
        </tbody>
    </table>
    <?php else:?>
    <div class="empty_order">
        <?php echo $this->translate('MSG_EMPTY_ORDER');?>
    </div>
    <?php endif;?>
</div>
<div class="right_col">
    <?php echo $this->partial("index/_purchaseInstruction.phtml", array(
        'store' => $this->store
    ));?>
    
    <?php echo $this->partial("index/_recentViewedProducts.phtml", array(
        'social' => $this->social,
        'rv_products' => $this->rv_products,
        'store' => $this->store
    ));?>
</div>

<?php echo $this->partial('index/scrollTop.phtml');?>